﻿<UserControl x:Class="Coproject.Views.ToDoItemView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:dataForm="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.DataForm.Toolkit"
    xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
    xmlns:bi="clr-namespace:CoProjectDF.Controls"
    xmlns:helpers="clr-namespace:Coproject.Helpers"
    mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="400"
    >

    <d:DesignProperties.DataContext>
        <Binding Path="ToDoItemViewModel" Source="{StaticResource ViewModelLocator}"/>
    </d:DesignProperties.DataContext>
    
    <Grid>
        <dataForm:DataForm CurrentItem="{Binding Item}" IsReadOnly="{Binding IsReadOnly}" HorizontalAlignment="Stretch">
            <StackPanel>
                <dataForm:DataField PropertyPath="DueDate">
                    <controls:DatePicker SelectedDate="{Binding DueDate,Mode=TwoWay}" />
                </dataForm:DataField>
                <dataForm:DataField PropertyPath="Content">
                    <TextBox Text="{Binding Content,Mode=TwoWay}" TextWrapping="Wrap" Height="auto"
                             helpers:BindingHelper.UpdateSourceOnChange="True"/>
                </dataForm:DataField>
                <dataForm:DataField PropertyPath="User">
                    <TextBlock Text="{Binding User.FriendlyName}" />
                </dataForm:DataField>
            </StackPanel>
        </dataForm:DataForm>
    </Grid>

</UserControl>
